package edu.johnpank.libassistant.repo

import edu.johnpank.libassistant.entity.Book
import org.springframework.data.repository.CrudRepository
import org.springframework.stereotype.Repository
import java.util.*

@Repository
interface BookRepository: CrudRepository<Book?, Long> {

    override fun findAll(): MutableIterable<Book>

    fun findByAuthorContainingIgnoreCaseOrTitleContainingIgnoreCaseOrSeriesContainingIgnoreCaseOrGenreContainingIgnoreCase(author: String, title: String, series:String, genre:String): MutableIterable<Book>

    override fun findById(id: Long): Optional<Book?>

    fun findByIsbn(isbn: String): Optional<Book>

//    fun findByTitleContainingIgnoringCase(name: String): List<Book>?

}